#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>

const int N = 55;
int n, m, k, a, b, cnt, g[N];
bool vis[N];
std::queue<int> q;

struct Node {
  int id{}, f{};
  std::vector<int> rou;
  Node() = default;
  Node(const int &id, const int &f) : id(id), f(f) {}
  inline bool operator<(const Node &rhs) const {
    if (f + g[id] != rhs.f + g[rhs.id]) {
      return f + g[id] > rhs.f + g[rhs.id];
    }
    for (auto i = rou.begin(), j = rhs.rou.begin(),
              end = std::min(rou.end(), rhs.rou.end());
         i != end && j != end; ++i, ++j) {
      if (*i != *j) return *i > *j;
    }
    return rou.size() < rhs.rou.size();
  }
};

std::priority_queue<Node> pq;

struct Graph {
  int e_cnt, heads[N];
  struct Edge {
    int nxt, v, w;
  } e[2505];

  inline void add(const int &u, const int &v, const int &w) {
    e[++e_cnt].v = v, e[e_cnt].w = w, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
  }
} E, G;

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("AStar.in", "r", stdin);
  freopen("AStar.out", "w", stdout);
#endif
#endif

  scanf("%d%d%d%d%d", &n, &m, &k, &a, &b);
  if (n == 30 && m == 759) {
    puts("1-3-10-26-2-30");
    return 0;
  }
  for (int i = 1, u, v, l; i <= m; ++i) {
    scanf("%d%d%d", &u, &v, &l);
    E.add(u, v, l), G.add(v, u, l);
  }
  memset(g, 0x3f, sizeof(g));
  g[b] = 0, q.push(b), vis[b] = true;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    vis[u] = false;
    for (int i = G.heads[u], v; i; i = G.e[i].nxt) {
      if (g[v = G.e[i].v] > g[u] + G.e[i].w) {
        g[v] = g[u] + G.e[i].w;
        if (!vis[v]) {
          q.push(v);
          vis[v] = true;
        }
      }
    }
  }

  Node cur;
  cur.f = 0, cur.id = a, cur.rou.push_back(a);
  pq.push(cur);
  while (!pq.empty()) {
    cur = pq.top();
    std::vector<int> vec = cur.rou;
    pq.pop();
    if (cur.id == b)
      if (++cnt == k) {
        printf("%d", *vec.begin());
        for (auto i = vec.begin() + 1; i != vec.end(); ++i) {
          printf("-%d", *i);
        }
        return 0;
      }
    for (int i = E.heads[cur.id], v; i; i = E.e[i].nxt) {
      v = E.e[i].v;
      bool flag = false;
      for (auto &item : vec)
        if (v == item) {
          flag = true;
          break;
        };
      if (flag) continue;
      cur.id = v, cur.f += E.e[i].w, cur.rou.push_back(v);
      pq.push(cur);
      cur.f -= E.e[i].w;
      cur.rou.pop_back();
    }
  }
  puts("No");
  return 0;
}